<template>
  <!-- 图例弹窗 -->
  <div class="legend-popup">
    <div class="legend-title">{{ title }}</div>
    <span class="close_popup" @click="closePopup">x</span>
    <div class="legend-item">
      <span>属性名：</span>
      <span>属性值</span>
    </div>
  </div>
</template>

<script lang="ts" setup>
const props = defineProps(["title", "key"]);
const emits = defineEmits(["close"]);

function closePopup() {
  emits("close", props.key);
}
</script>

<style lang="scss" scoped>
.legend-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 200px;
  background-color: #fff;
  z-index: 1000;

  .close_popup {
    position: absolute;
    right: 9px;
    top: 2px;
    font-size: 22px;
    color: red;
    cursor: pointer;
  }
}
</style>
